#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <math.h>
using namespace std;
long long yue(long long a, long long b)
{
	long long r;
	while ((r = a % b) != 0)
	{
		a = b;
		b = r;
	}
	return b;
}
int main()
{
	int n;
	cin >> n;
	long long x[100], y[100];
	long long minbei = 0;
	for (int i = 0; i < n; i++)
	{
		scanf("%lld/%lld", &x[i], &y[i]);
		if (i == 0)
		{
			minbei = y[i];
		}
		else
		{
			minbei = y[i] / yue(minbei, y[i]) * minbei;
		}
	}
	long long c = 0;
	for (int i = 0; i < n; i++)
	{
		c += x[i] * (minbei / y[i]);
	}
	long long t = yue(c, minbei);
	c /= t;
	minbei /= t;
	if (c == 0)
		cout << '0' << endl;
	else if (abs(c) < minbei)
	{
		cout << c << '/' << minbei << endl;
	}
	else
	{
		if (c % minbei == 0)
			cout << c / minbei << endl;
		else
			cout << c / minbei << ' ' << c % minbei << '/' << minbei << endl;
	}
	return 0;
}